﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2023_09_13
{
    internal class Class3
    {
        static void Main5(string[] args)
        {
            int n;
            Console.WriteLine(value: "输入n:");
            n = int.Parse(s: Console.ReadLine());
            int sum = getAestheticsSum(n);
            Console.WriteLine(value: sum.ToString());
        }
        
        public static int getAestheticsSum(int n)
        {
            if (n == 1) 
                return 1;
            return getCurrentNum(n) + getAestheticsSum(n: n - 1); 
        }

        public static int getCurrentNum(int n)
        {
            if (n == 1 || n == 0)
                return 1; 
            if (n % 2 == 0)
                return getCurrentNum(n: n - 2) + n * n;
            return getCurrentNum(n: 1) + n * n;
        }
    }
}
